from keras.preprocessing.sequence import pad_sequences
from keras_preprocessing.sequence import pad_sequences

sequences =[
    [1,2,3,5],
    [5,6,7],
    [5,6],
    [2]
] 
padded = pad_sequences(sequences)
print(padded)
